import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 收藏信息信息 */
export interface Collect {
          id: number; // 收藏id
          module: string; // 模块
          title: string; // 标题
  }

// 收藏信息 API
export const CollectApi = {
  // 查询收藏信息分页
  getCollectPage: async (params: any) => {
    return await request.get({ url: `/biz/collect/page`, params })
  },

  // 查询收藏信息详情
  getCollect: async (id: number) => {
    return await request.get({ url: `/biz/collect/get?id=` + id })
  },

  // 新增收藏信息
  createCollect: async (data: Collect) => {
    return await request.post({ url: `/biz/collect/create`, data })
  },

  // 修改收藏信息
  updateCollect: async (data: Collect) => {
    return await request.put({ url: `/biz/collect/update`, data })
  },

  // 删除收藏信息
  deleteCollect: async (id: number) => {
    return await request.delete({ url: `/biz/collect/delete?id=` + id })
  },

  /** 批量删除收藏信息 */
  deleteCollectList: async (ids: number[]) => {
    return await request.delete({ url: `/biz/collect/delete-list?ids=${ids.join(',')}` })
  },

  // 导出收藏信息 Excel
  exportCollect: async (params) => {
    return await request.download({ url: `/biz/collect/export-excel`, params })
  },
}